﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Reflection;

namespace PCHenry.miFlashlight
{
  public class ApplicationInformation
  {

    private string verionInformation = "x.y.z";

    public string VersionInformation
    {
      get
      {
        return verionInformation;
      }
      set
      {
        verionInformation = value;
      }
    }

    private string applicationName = "miFlashlight";

    public string ApplicationName
    {
      get
      {
        return applicationName;
      }
      set
      {
        applicationName = value;
      }
    }


    private ApplicationInformation()
    {
      Assembly assembly = Assembly.GetExecutingAssembly();
      if( assembly != null )
      {
        string[] assemlbyInformationParts = assembly.FullName.Split( ',' );
        if( !string.IsNullOrEmpty( assemlbyInformationParts[0] ) )
        {
          applicationName = assemlbyInformationParts[0];
        }
        if( !string.IsNullOrEmpty( assemlbyInformationParts[1] ) )
        {
          VersionInformation = assemlbyInformationParts[1].ToString().Trim();
        }
      }
    }

    public static ApplicationInformation Create()
    {
      ApplicationInformation applicationInformation = new ApplicationInformation();
      return applicationInformation;
    }
  }
}
